<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" 
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../header.jsp"%>
<link rel="stylesheet" type="text/css" href="<%=resourceBase%>customCSS/data/data.css">
<script type="text/javascript" src="<%=resourceBase%>customJS/data/data.js"></script>
</head>
 
<body>
<div id="body-wrapper">
<!-- Wrapper for the radial gradient background -->

<!-- sidebar.jsp -->
<%@ include file="../sidebar.jsp"%>
<div id="gridContent">
	<!-- Main Content Section with everything -->

	<!-- Page Head -->
	<h2><fmt:message key="report.${type}"/>数据</h2>
	<p id="page-intro"><fmt:message key="report.${type}"/>数据</p>
	<div id="bodyWrapper">
	<div id="queryItems">
		<form id="scopeSearch" action="search" method="post">
		<div>
		<span class="qitem"><label for="site">站点</label><select name="siteId" id="site">
			<c:forEach var="site" items="${userSites}">
				<option title="${site.name}" value="${site.id}">${site.name}</option>
			</c:forEach>
			</select>
		</span>
		<c:choose>
			<c:when test="${type == 'year'}">
			<span class="qitem"><label for="startYear">起始时间</label><select name="startYear" id="startYear"></select>年</span>
			<span class="qitem"><label for="endYear">结束时间</label><select name="endYear" id="endYear"></select>年</span>
			</c:when>
			<c:when test="${type == 'quarter'}">
			<span class="qitem"><label for="startYear">起始时间</label><select name="startYear" id="startYear"></select>年&nbsp;&nbsp;&nbsp;&nbsp;第<select name="startQuarter" id="startQuarter"></select>季度</span>
			<span class="qitem"><label for="endYear">结束时间</label><select name="endYear" id="endYear"></select>年&nbsp;&nbsp;&nbsp;&nbsp;第<select name="endQuarter" id="endQuarter"></select>季度</span>
			</c:when>
			<c:when test="${type == 'month'}">
			<span class="qitem"><label for="startYear">起始时间</label><select name="startYear" id="startYear"></select>年&nbsp;&nbsp;&nbsp;&nbsp;<select name="startMonth" id="startMonth"></select>月</span>
			<span class="qitem"><label for="endYear">结束时间</label><select name="endYear" id="endYear"></select>年&nbsp;&nbsp;&nbsp;&nbsp;<select name="endMonth" id="endMonth"></select>月</span>
			</c:when>
			<c:when test="${type == 'week'}">
			<span class="qitem"><label for="startYear">起始时间</label><select name="startYear" id="startYear"></select>年&nbsp;&nbsp;&nbsp;&nbsp;<select name="startWeek" id="startWeek"></select>周</span>
			<span class="qitem"><label for="endYear">结束时间</label><select name="endYear" id="endYear"></select>年&nbsp;&nbsp;&nbsp;&nbsp;<select name="endWeek" id="endWeek"></select>周</span>
			</c:when>
			<c:when test="${type == 'day'}">
			<span class="qitem"><label for="startDate">起始时间</label><input class="text-input" name="startDate" id="startDate" type="text"/></span>
			<span class="qitem"><label for="endDate">结束时间</label><input class="text-input" name="endDate" id="endDate" type="text"/></span>
			</c:when>
			<c:when test="${type == 'second' || type == 'hour'}">
			<span class="qitem"><label for="startDate">起始时间</label><input class="text-input" name="startDate" id="startDate" type="text"/>&nbsp;&nbsp;&nbsp;&nbsp;<select name="startHour" id="startHour"></select>时</span>
			<span class="qitem"><label for="endDate">结束时间</label><input class="text-input" name="endDate" id="endDate" type="text"/>&nbsp;&nbsp;&nbsp;&nbsp;<select name="endHour" id="endHour"></select>时</span>
			</c:when>
		</c:choose>
		</div>
		</form>
		
		<div class="siteitems" style="display:none">
		<c:forEach var="items" items="${siteItems}">
			<ul id="items_${items.key}" style="display:none;">
			<c:forEach var="item" items="${items.value}">
				<li class="item-li"><input type="checkbox" name="siteItems" checked value="${item.id}" id="siteitem_${item.id}" title="${item.item.name}" item="${item.item.id}" unit="${item.item.standUnit}"/></li>
			</c:forEach> 
			</ul>
		</c:forEach> 
		</div>
	</div>
	</div>
	<div>
	<span><input type="button" id="collapse" value="收起查询条件"/></span>
	<div class="btns">
	<input type="button" id="searchBtn" value="查询"/> 
	</div>
	</div>
	<div id="grid"></div>
	</div>
</div>
<script type="text/javascript">
	var type = '${type}', pageId;
	switch(type) {
	case 'second': pageId = '2_MJSJ';break;
	case 'hour': pageId = '2_XSSJ';break;
	case 'day': pageId = '2_MRSJ';break;
	case 'week': pageId = '2_MZSJ';break;
	case 'month': pageId = '2_MYSJ';break;
	case 'quarter': pageId = '2_JDSJ';break;
	case 'year': pageId = '2_MNSJ';break;
	}
	$.setCurrentMenu(pageId);

	var flags = ${flags};
</script>
</body>
</html>
